const router = require('koa-router')();

router.prefix('/todo');

router.get('/', async ctx => {
  ctx.redirect('/admin/todo/index')
});

router.get('/index', async ctx => {
  ctx.render('admin/todo/index', {
    list: [
      {task: '更新系统', progress: 55, status: 'danger'},
      {task: '清除无用数据', progress: 70, status: 'warning'},
      {task: 'UI界面完善', progress: 30, status: 'primary'},
      {task: '修复BUG', progress: 90, status: 'success'},
      {task: '上传相关资料', progress: 65, status: 'warning'}
    ]
  })
});

module.exports = router;